package two.dimensional.arrays;

/**
 * @author shkstart
 * @date 2022/4/16 - 22:24
 */
public class ArrayDemo02 {
    public static void main(String[] args) {
//        一维初始化
        boolean arr[] = new boolean[3];
        String arr1[] = new String[]{"你哈送","无解"};
        int arr2[] = {1,2,3};

//      二维初始化
        boolean ar3r[][] = new boolean[3][2];
        String arr4[][] = new String[][]{{"你哈送","无解"},{"我是arm","呼啦啦的神"}};
        System.out.println(arr4[1]);//地址值
        System.out.println(arr4[1][1]);//呼啦啦的神
        int arr5[][] = {{1,2,3},{2,3,4},{2,1}};

//        3.如何遍历如下的二维数组
        int[] arr6[] = new int[][]{{1,2,3},{4,5},{6,7,8}};
        for (int i = 0; i < arr6.length; i++ ) {
            for (int j = 0; j < arr6[i].length; j++ ) {
                System.out.print(arr6[i][j]);
            }
            System.out.println();
        }


    }
}
